-
Notifications
You must be signed in to change notification settings - Fork 764
Update outbox macro #5970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update outbox macro #5970
Conversation
{% set comma = joiner(', ') %} | ||
{% for user in message.to.all() -%} | ||
{{ comma() }} | ||
{{ name_link(user) }} | ||
{%- endfor %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice change, but now the inner loop should be removed and the set comma ...
moved outside the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks. I saw another piece that needed updated as well thanks to this!
@@ -52,27 +52,27 @@ | |||
|
|||
{% macro outbox_message(message) -%} | |||
<span class="to"> | |||
{% if message.recipient %} | |||
{% if message.to %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, but I'm wondering if it would be better to use if message.recipients_count > 0
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
{% for user in message.to.all() -%} | ||
{{ comma() }} | ||
{{ name_link(user) }} | ||
{%- endfor %} | ||
{% else %} | ||
{{ name_link(message.recipient) }} | ||
{% endif %} | ||
{% endfor %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdent all of these lines -- the for...else...endfor
to match the line with the {% set comma = joiner(', ') %}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did as requested - I need to find some rules/a linter for Jinja files.....
No description provided.